package ru.st.selenium.pages;

import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;


public class FilmListPage extends InternalPage{
	
	public FilmListPage(PageManager pages) {
		super(pages);
	}
	
	@FindBy(id = "q")
    private WebElement searchNameFilm;  
	
	@FindBy(css = "#results .content")
	private WebElement searchFirstNameFilm;
	
	@FindBy(css = "#results a:nth-of-type(1) .title")
	private WebElement searchAnyNameFilm;
	
	public FilmListPage setSearchNameFilm(String text) {
    	  searchNameFilm.clear();
		  searchNameFilm.sendKeys(text + Keys.RETURN);
	    return this;
	}
  
    public String getSearchFirstNameFilm() {
	    return searchFirstNameFilm.getText();
	}	
	
	public String getSearchAnyNameFilm() {
	    return searchAnyNameFilm.getText();
	}

}
